<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>循环示例</title>
		<script type="text/javascript">
			var x = "";
			for (var i = 0; i < 5; i++) {
				x = "该数字为 " + i + "<br>";
				if (i == 2) {
					continue;
				}
				if (i == 3) {
					break;
				}
				document.write(x); //输出：该数字为0, 该数字为1
			}
			document.write("<hr />");
            var i = 1,
				sum = 0;
			while (i < 101) {
				sum += i;
				i++;
			}
			document.write(sum); //输出：5050
			document.write("<hr />");
			var x = "", i = 0;
			do {
				x = x + "该数字为 " + i + "<br>";
				i++;
			}
			while (i < 5)
			document.write(x);
            var y = "", j = 0;
            while (j < 5){
                y = y + "该数字为 " + j + "<br>";
				j++;
            }
            document.write(y);
		</script>
	</head>
	<body>
	</body>
</html>
